﻿using MengLin.OOP.DesignPattern.Flyweight.Letter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace MengLin.OOP.DesignPattern.Flyweight.Implements
{
    /// <summary>
    /// 字母E
    /// </summary>
    public class E : BaseWord
    {
        long iResult = 0;
        /// <summary>
        /// 一个耗时耗资源的构造函数，
        /// 表明构造对象比较消耗资源
        /// </summary>
        public E()
        {
            for (int i = 0; i < 100000; i++)
            {
                iResult+=i;
            }
            Thread.Sleep(1000);
            Console.WriteLine($"{this.GetType().Name}被构造");
        }

        public override string Get()
        {
            return this.GetType().Name;
        }
    }
}
